import request from '@/utils/request'

// 查询交易群主列表
export function listGroup(query) {
  return request({
    url: '/business/group/list',
    method: 'get',
    params: query
  })
}

// 查询交易群主详细
export function getGroup(id) {
  return request({
    url: '/business/group/' + id,
    method: 'get'
  })
}

// 新增交易群主
export function addGroup(data) {
  return request({
    url: '/business/group',
    method: 'post',
    data: data
  })
}

// 修改交易群主
export function updateGroup(data) {
  return request({
    url: '/business/group',
    method: 'put',
    data: data
  })
}

// 删除交易群主
export function delGroup(id) {
  return request({
    url: '/business/group/' + id,
    method: 'delete'
  })
}


export function listGroupList(query) {
  return request({
    url: '/business/group/listGroup',
    method: 'get',
    params: query
  })
}


export function listGroupUser(query) {
  return request({
    url: '/business/group/listGroupUser',
    method: 'get',
    params: query
  })
}


// 新增交易群主组员
export function addGroupUserData(data) {
  debugger
  return request({
    url: '/business/group/addGroupUser',
    method: 'post',
    data: data
  })
}


export function financialInformation(tdAccs) {
  return request({
    url: '/business/group/optlist',
    method: 'get',
    params: tdAccs // params会自动序列化数组
  })
}


export function batchBuy(data) {
  console.log(data)
  return request({
    url: '/business/group/batchBuyData',
    method: 'post',
    data: data ,
    timeout: 600000
  })
}

export function batchOpeningData(data){
  return request({
    url: '/business/group/batchOpening',
    method: 'post',
    data: data ,
    timeout: 600000
  })
}

export function batchSellSymbolData(data){
  return request({
    url: '/business/group/batchSellSymbol',
    method: 'post',
    data: data ,
    timeout: 600000
  })
}
export function batchCancelOrder(data){
  return request({
    url: '/business/group/entrustOrderCancel',
    method: 'post',
    data: data ,
    timeout: 600000
  })
}


export function listUserAll() {
  return request({
    url: '/business/group/searchAccount',
    method: 'get',
    // params: { keyword: query }
  })
}